﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KamLib
{
    public class HtmlException:Exception
    {
        public HtmlException(Exception innerException) :
            base(innerException.FullMessage().Replace("\r\n", "<br>"), innerException)
        {
        }

        public static void Try(Action action)
        {
            if (action == null) return;

            try
            {
                action();
            }
            catch (Exception ex)
            {
                throw new HtmlException(ex);
            }
        }
    }
}
